package cn.bdqn.service.impl;

import cn.bdqn.mapper.SysRoleRightMapper;
import cn.bdqn.pojo.SysRoleRight;
import cn.bdqn.service.SysRoleRightService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wei
 * @since 2024-05-31
 */
@Service
public class SysRoleRightServiceImpl   implements SysRoleRightService {
    @Resource
    SysRoleRightMapper sysRoleRightMapper;
    @Override
    public int addSysRoleRight(SysRoleRight sysRoleRight) {
        return sysRoleRightMapper.insert(sysRoleRight);
    }

    @Override
    public int deleteSysRoleRightByRoleId(Long roleId) {
        QueryWrapper<SysRoleRight> qw=new QueryWrapper<>();
        qw.eq("rf_role_id",roleId);
        return sysRoleRightMapper.delete(qw);
    }
}
